package com.mlk.good.controller;

import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import com.mlk.good.service.EngGoodOrderService;
import com.mlk.good.vo.EngGoodOrderVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 商城订单管理
 */
@Controller
@RequestMapping("/eng/good/order")
public class EngGoodOrderController {

    @Resource
    private EngGoodOrderService engGoodOrderService;

    /**
     * 回到商城管理页面
     * @return
     */
    @RequestMapping("index")
    public String  index(){
        return "good/order";
    }

    /**
     * 分页查询
     * @param vo
     * @return
     */
    @ResponseBody
    @RequestMapping("listPage")
    public Pager listPage(EngGoodOrderVO vo){
        return this.engGoodOrderService.listPage(vo);
    }


    /**
     * 用户接单
     * @param orderCode
     * @return
     */
    @ResponseBody
    @RequestMapping("accept")
    public ServerResponse accept(String orderCode){
        return this.engGoodOrderService.accept(orderCode);
    }

    /**
     * 订单发货
     * @return
     */
    @RequestMapping("send")
    @ResponseBody
    public ServerResponse send(String orderCode){
        return this.engGoodOrderService.send(orderCode);
    }
}
